<template>

     <radio-group  @change="radioChange">
                  <label  class="weui-check__label" v-for="(item,index) in radio" :key="index">
                     <radio class="weui-check" :disabled="disabled" :value="item.value"/>
                    <div class="weui-cell__hd weui-check__hd_in-checkbox">
                      <icon class="weui-icon-checkbox_circle" type="circle" size="23"  v-if="!item.checked"></icon>
                      <icon class="weui-icon-checkbox_success" type="success" size="23" v-if="item.checked"></icon>
                    </div>
                    <div class="weui-cell__bd">{{item.name}}</div>
                  </label>
    </radio-group>

</template>

<script>
export default {
    data(){
        return {
            radio:[
                {"name": "不通过", "value": 1 ,checked: false},
                {"name": "通过", "value": 2},
            ]
        }
    },
    methods:{
      radioChange(e) {
               this.radio.map((item,index)=>{
                  item.checked = item.value == e.mp.detail.value 
              })
           
              this.$emit("check_id",e.mp.detail.value )
      },
    },
    mounted(){

       this.radio.map((item,index)=>{
              item.checked = item.value == this.status 
          })


      if(this.status!=1||this.status!=2){
        this.radio[0].checked = true ;
      }
         
    },
    props:["status","disabled"],
      
  
}
</script>
